<?php
/**
 * 2017年6月6日12:21:46
 * PDO SAFE
 */

include 'common.php';

try {	
	$dbc = pdo_root_connect();
	
	$addr = $_SERVER['REMOTE_ADDR'];
	$time = time();
	
	$stmt = $dbc->prepare('select * from hopetype');
	$stmt->execute();
	
	$list = array();
	while($row = $stmt->fetch()){
		array_push($list, $row['description']);
	}
	$errorcode = 1;
}catch (PDOException $e){
	$msg = $e->getMessage();
	$errorcode = 4;
}

echo json_encode(array('errorcode'=>$errorcode, 'msg' => $msg, 'hopelist'=>$list));
?>